<div class="content-section introduction">
  <div>
    <span class="feature-title">设备管理<span class="gt">&gt;</span>导入设备</span>
  </div>
</div>
<div class="content-section implementation GridDemo">
  <div class="mybutton">
    <button pButton type="button"  label="导入模板下载" (click)="exportExcel()"></button>
    <button pButton type="button"  label="批量导入"  (click)="showImport()"></button>
    <button pButton type="button"  label="添加" (click)="showAdd()"></button>
  </div>
  <p-dataTable [value]="assets" [lazy]="true" [rows]="10" [paginator]="true" [rowsPerPageOptions]="[5,10,20]" emptyMessage="没有数据"
               [totalRecords]="totalRecords" (onLazyLoad)="loadCarsLazy($event)">
    <p-column  *ngFor="let col of cols" field="{{col.field}}" header="{{col.header}}"></p-column>
  </p-dataTable>
</div>
<app-add-or-update-device  *ngIf="showAddMask" [state]="state" (closeAddMask)="removeMask($event)" (addDev)="addDevice($event)"></app-add-or-update-device>
<!--批量导入model-->
<p-dialog [(visible)]="display" modal="modal"  [responsive]="true">
  <p-header>
    资产批量导入
  </p-header>
  <div class="ui-g">
    <div class="ui-g-12">
      <div class="file-box">
        <form method="post" enctype="multipart/form-data">
          <input type='text' name='textfield' #textfield id='textfield' class='txt' />
          <input type='button' class='btn' value='浏览...' />
          <input type="file" name="fileField" class="file" id="fileField" #fileField size="28" onchange="textfield.value=fileField.value" [uploader]="uploader" ng2FileSelect /><br><br>
        </form>
      </div>
    </div>
  </div>
  <p-footer>
    <button type="button" pButton icon="fa-check" (click)="uploader.uploadAll();display=false;textfield.value='';fileField.value=''"  label="确定"></button>
    <button type="button" pButton icon="fa-close" (click)="display = false;textfield.value='';fileField.value=''" label="取消"></button>
  </p-footer>
</p-dialog>
